<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
  <style>
  * { margin:0px; padding:0px; border-width:0px}
  #main { position:absolute;
     width:100%;
     top:0;
     left:0;width:100%;height:100%; border-width:0px; border-color:blue;margin:0px; /*background-color:aqua*/ }
  #main-iframe { width:100%;height:100%;border-width:0px; border-color:red; margin:0px; }
  </style>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="./core/event.js"></script>
  <script src="./core/json.js"></script>
<script>

commonLauncher = 
{
  run: function(app) { try{

    var search = "";
    if ( app.params )
      search="?params="+encodeURIComponent( JSON.stringify(app.params) );
    //alert(app.url);
    
    var ifr = document.getElementById("main-iframe");
    
    
    if (ifr.contentWindow && ifr.contentWindow.Dispose)
      ifr.contentWindow.Dispose();
    ifr.setAttribute("src", app.url + search);

  } catch(e) { alert(e.message) } }


};

function OnLoad()
{
  try
  {
    window.comet = window.parent.comet;
    window.acc = window.parent.acc;
    window.model = window.parent.model;
    window.ctrl = window.parent.ctrl;
    window.launcher = window.parent.launcher;
    window.launcher.subscribe( function(app) {commonLauncher.run(app)} );
  }
  catch(e)
  {
    alert(e.message);
  }
}

Event.add(window, 'load', OnLoad)

</script>
</HEAD>
<BODY>
<div id = "main">
  <iframe id = "main-iframe" ></iframe>
</div>
</BODY>
</HTML>
